#region COPYRIGHT
//--------------------------------------------------------------------------------
// <copyright file="LightManager.cs" company="starLiGHT Entertainment Studios">
//    Copyright (c) 2011
//       Roland Rosenkranz (Glatzemann@email.de)
// </copyright>
// <license>
//   This file is part of starLiGHT.Render.
//
//   starLiGHT.Render is free software: you can redistribute it and/or modify
//   it under the terms of the GNU Lesser General Public License as published by
//   the Free Software Foundation, either version 3 of the License, or
//   (at your option) any later version.
//
//   starLiGHT.Render is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU Lesser General Public License for more details.
//
//   You should have received a copy of the GNU Lesser General Public License
//   along with starLiGHT.Render. If not, see http://www.gnu.org/licenses/.
//    
//   ADDITIONAL (commercial) LICENSES for starLiGHT.Render are available on request.
// </license>
// <version>
// **************[ starLiGHT.Engine SVN ]**********************
// * $Rev::                       $:  Revision of last commit *
// * $Author::                    $:  Author of last commit   *
// * $Date::                      $:  Date of last commit     *
// ************************************************************
// </version>
//--------------------------------------------------------------------------------
#endregion

namespace starLiGHT.Light
{
    #region Using Statements
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    #endregion

    public class LightManager
    {
        private Dictionary<string, ILight> lights;

        public LightManager()
        {
            this.lights = new Dictionary<string, ILight>();
        }

        public void AddLight(string name, ILight light)
        {
            this.lights.Add(name, light);
        }

        public bool HasLight(string name)
        {
            return this.lights.ContainsKey(name);
        }

        public bool HasLight(ILight light)
        {
            return this.lights.ContainsValue(light);
        }

        public void RemoveLight(string name)
        {
            ILight lightToRemove;

            if (this.lights.TryGetValue(name, out lightToRemove))
            {
                this.lights.Remove(name);
            }
        }
    }
}